#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> singleNumber(vector<int>& nums) 
{
    sort(nums.begin(), nums.end());
    /*for(auto e : nums)
    {
        cout << e << " ";
    }
    cout << endl;*/
    vector<int> ret;
    ret.reserve(2);
    int cout = 0;
    int i = 0;
    while (i < nums.size() - 1)
    {
        if (cout == 2)
        {
            break;
        }
        if (i == 0 && (nums[0] != nums[1]))
        {
            ret.push_back(nums[0]);
            cout++;
        }
        else if ((i >= 1) && (nums[i] != nums[i - 1] && nums[i] != nums[i + 1]) && (i < nums.size()-1))
        {
            ret.push_back(nums[i]);
            ++cout;
        }
        i++;
    }
    if (cout != 2)
    {
        ret.push_back(nums[nums.size() - 1]);
    }
    return ret;
}
int main()
{
    vector<int> nums;
    nums.reserve(6);
    nums.push_back(0);
    nums.push_back(1);
    nums.push_back(1);
    nums.push_back(2);
    vector<int> ret = singleNumber(nums);
    vector<int>::iterator it = ret.begin();
    while (it < ret.end())
    {
        cout << *it << endl;
        it++;
    }
    cout << endl;
    return 0;
}
//#include<iostream>
//#include<vector>
//using namespace std;
//void test()
//{
//	vector<int> ret;
//	ret.reserve(2);
//}
//int main()
//{
//	vector<int> ret;
//	ret.reserve(2);
//	test();
//	return 0;
//}